package guesswords.khova.com;

public class GameFunctions{
	
	/*
	 * Convert Character to Lowercase
	 */
	public static char convertChar(char pchar)
	{
		char lower = Character.toLowerCase(pchar);
		
		return lower;
	}
	
	/*
	 * Coordinate Letter/Value with Position
	 */
	public static int findLetterGFX(char axis, char theletter, int width, int height)
    {
        int xpos, ypos, value;
 
        switch (theletter)
        {
            case 'a':
                xpos = 0; ypos = 0;
                break;
            case 'b':
                xpos = width; ypos = 0;
                break;
            case 'c':
                xpos = width * 2; ypos = 0;
                break;
            case 'd':
                xpos = width * 3; ypos = 0;
                break;
            case 'e':
                xpos = width * 4; ypos = 0;
                break;
            case 'f':
                xpos = 0; ypos = height;
                break;
            case 'g':
                xpos = width; ypos = height;
                break;
            case 'h':
                xpos = width * 2; ypos = height;
                break;
            case 'i':
                xpos = width * 3; ypos = height;
                break;
            case 'j':
                xpos = width * 4; ypos = height;
                break;
            case 'k':
                xpos = 0; ypos = height * 2;
                break;
            case 'l':
                xpos = width; ypos = height * 2;
                break;
            case 'm':
                xpos = width * 2; ypos = height * 2;
                break;
            case 'n':
                xpos = width * 3; ypos = height * 2;
                break;
            case 'o':
                xpos = width * 4; ypos = height * 2;
                break;
            case 'p':
                xpos = 0; ypos = height * 3;
                break;
            case 'q':
                xpos = width; ypos = height * 3;
                break;
            case 'r':
                xpos = width * 2; ypos = height * 3;
                break;
            case 's':
                xpos = width * 3; ypos = height * 3;
                break;
            case 't':
                xpos = width * 4; ypos = height * 3;
                break;
            case 'u':
                xpos = 0; ypos = height * 4;
                break;
            case 'v':
                xpos = width; ypos = height * 4;
                break;
            case 'w':
                xpos = width * 2; ypos = height * 4;
                break;
            case 'x':
                xpos = width * 3; ypos = height * 4;
                break;
            case 'y':
                xpos = width * 4; ypos = height * 4;
                break;
            case 'z':
                xpos = 0; ypos = height * 5;
                break;
            case '-':
                xpos = width * 1; ypos = height * 5;
                break;
            case '/':
                xpos = width * 2; ypos = height * 5;
                break;
            case '\'':
                xpos = width * 3; ypos = height * 5;
                break;
            case ',':
                xpos = width * 4; ypos = height * 5;
                break;
            case GuessWordz.REDBLOCK:
            	xpos = width * 1; ypos = height * 6;
            	break;
            case GuessWordz.BLUEBLOCK:
            	xpos = width * 0; ypos = height * 6;
            	break;


            default:
                xpos = 0; ypos = 0;

                break;

        }
        if (axis == 'x')
        {
            value = xpos;
        }
        else
        {
            value = ypos;
        }
        return value;


    }
	
	
	
}